﻿using UnityEngine;
using UnityEditor;
using System.Collections;

public class VisibleTransform : MonoBehaviour 
{

	void OnDrawGizmos()
    {
        var width = transform.localScale.x / 2;
        var height = transform.localScale.y / 2;
        if (Selection.Contains(gameObject))
        {
            Debug.DrawLine(new Vector3(transform.position.x - width, transform.position.y - height), new Vector3(transform.position.x + width, transform.position.y - height));
            Debug.DrawLine(new Vector3(transform.position.x + width, transform.position.y - height), new Vector3(transform.position.x + width, transform.position.y + height));
            Debug.DrawLine(new Vector3(transform.position.x + width, transform.position.y + height), new Vector3(transform.position.x - width, transform.position.y + height));
            Debug.DrawLine(new Vector3(transform.position.x - width, transform.position.y + height), new Vector3(transform.position.x - width, transform.position.y - height));
        }
	}
}
